#!/usr/bin/env python

import socket

site = 'labf'
s_path = '/opt/omd/sites/' + site + '/tmp/run/live'

s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect(s_path)

s.send('GET hosts\nColumns: host_name name address state\nOutputFormat: python\n')

s.shutdown(socket.SHUT_WR)

answer = s.recv(1000000)

#table = [ line.split(';') for line in answer.split('\n')[:-1] ]

print (answer)
